
#ifndef _KEYSCAN_H_
#define _KEYSCAN_H_

#include <Arduino.h>
#include "BleKeyboard.h"

enum{
    SW1_PIN = 22,
    SW2_PIN = 21,
    SW3_PIN = 5,
    ENCODER_SW_PIN = 23,
};

class NormalButton 
{
    public:
    uint8_t PIN;
    volatile uint8_t Trg = 0;
    volatile uint8_t Cont = 0;
    volatile uint8_t cnt_flag = 0;
    volatile uint8_t cnt_long_flag = 0;
    volatile int cnt_plus = 0;
    volatile uint8_t Release = 0; 
    private:   
};

struct ITRButton 
{
  const uint8_t PIN;
  uint32_t numberKeyPresses;
  bool pressed;
};

void KeyScan(NormalButton *key);
void key_trg(uint8_t pin);
void key_cont(uint8_t pin);
void key_cont_long(uint8_t pin);
void key_release(uint8_t pin);

#endif